import {FC, useContext} from "react";
import setting from "@/setting";
import style from "./index.module.scss"
import {StyleContext} from "@/context/style-context.tsx";
interface ISiderLogoProps {
    collapsed: boolean;
    className?: string;
}

const SlSiderLogo: FC<ISiderLogoProps> = ({collapsed, className}) => {
    const { namespace, elNamespace } = useContext(StyleContext);
    const styleList = {
        logo: `${namespace}-sider-logo`
    }
    const title = setting.appTitle;
    return (
        <div className={style[styleList.logo]}>
            {
                collapsed ? (
                    <img src="/app-icon.png" className={style[`${styleList.logo}-icon`]}/>
                ) : (
                    <div className={style[`${styleList.logo}-body`]}>
                        <img src="/app-icon.png"  className={style[`${styleList.logo}-body-icon`]}/>
                        {title}
                    </div>
                )
            }
        </div>
    )
}

export default SlSiderLogo;